home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _8133DB713787475AA244C67E12BB2079 < prev    next >
Encoding:
Text File  |  2004-01-06  |  627 b   |  23 lines

  1.       #include "../CGVPMacro.csi"
  2.  
  3.       MainInput { uniform sampler2D baseMap : texunit0,
  4.                   uniform samplerCUBE envMap : texunit1 }
  5.       DeclarationsScript
  6.       {
  7.         OUT_T0_T1_C0_C1
  8.         FOUT
  9.       }
  10.       CoreScript
  11.       {
  12.         // load the decal
  13.         float4 decalColor = tex2D(baseMap, IN.Tex0.xy);
  14.         float4 envColor = texCUBE(envMap, IN.Tex1.xyz);
  15.  
  16.         float3 col = (envColor.xyz * decalColor.a + decalColor.xyz) * IN.Color.xyz + IN.Color1.xyz;
  17.  
  18.         // finally add them all together
  19.         OUT.Color.xyz = col;
  20.         OUT.Color.w = IN.Color.a;
  21.       }
  22.  
  23.